/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package fy.mybatis.hr.manager;

import com.seeyon.ctp.common.AppContext;
import fy.mybatis.MyDBUtil_MyBatis;
import fy.mybatis.hr.po.HrUser;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

/**
 *
 * @author Administrator
 */
public final class HRUserManager2 {
    public static HrUser getUserByCode(String code) {
        HrUser user = null;
        SqlSessionFactory factory = MyDBUtil_MyBatis.getInstance().getFactory();
        SqlSession session = null;
        try {
            session = factory.openSession();
            user = new HrUser();
            user.setCode(code);
            user = session.selectOne("me.zc.hr.userMapper.getHRUser", user);
        } finally {
            if (session != null) {
                session.close();
                session = null;
            }
        }
        return user;
    }
}
